<?php
session_start(); 
require_once '../dto/messagerdto.php';
require_once '../dao/messagersdao.php';
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
    $message= $_REQUEST["ipmessage"];
    $MemberId = $_SESSION["Name"];
    $time = date('Y-m-d H:i:s');
    $messageObj = new messagerdto();
    $messageObj->_construct($MemberId,$message,$time);
    //inserdatabase here
    $res = messagersdao::addMessage($messageObj);
    if($res)
    {
        header("location:../page/home.php");
    }  else {
         header("location:../page/errorpage.php");
    }
?>
